<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改光刻板信息')" />
	<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-plateinfo-edit" th:object="${plateinfo}">
			<div class="form-group">
				<label class="col-sm-3 control-label">日期：</label>
				<div class="col-sm-8">
					<div class="input-group date">
						<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
						<input type="text" class="form-control" th:value="${plateinfo.createTime}" id="laydate-demo-2" placeholder="yyyy-MM-dd">
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">光刻板名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="lightPlateNo" id="lightPlateNo" th:value="*{lightPlateNo}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">位置：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="lightPlatePlace" id="lightPlatePlace" th:value="*{lightPlatePlace}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">状态：</label>
				<div class="col-sm-8">
					<div class="radio-box" th:each="dict : ${@dict.getType('light_plate_status')}">
						<input type="radio" th:id="${dict.dictCode}" name="lightPlateStatus" th:value="${dict.dictValue}" th:field="*{lightPlateStatus}">
						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">启用标识：</label>
				<div class="col-sm-8">
					<label class="toggle-switch switch-solid">
						<input type="checkbox" id="useStatus" th:checked="${plateinfo.useStatus == 0 ? true : false}" >
						<span></span>
					</label>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">是否异常：</label>
				<div class="col-sm-8">
					<label class="radio-box">
						否<input type="radio" value="0" id="isAbnormal1" name="isAbnormal" th:checked="${plateinfo.isAbnormal == 0 ? true : false}">
					</label>
					<label class="radio-box">
						是<input type="radio" value="1" id="isAbnormal2" name="isAbnormal" th:checked="${plateinfo.isAbnormal == 1 ? true : false}">
					</label>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 col-xs-2 control-label">备注：</label>
				<div class="col-sm-8 col-xs-10">
					<textarea id="remark" name="remark" maxlength="200" class="form-control" rows="3" th:text="*{remark}"></textarea>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: datetimepicker-js" />
	<script type="text/javascript">
		var prefix = ctx + "ph/plateinfo";
		$(function() {
			layui.use('laydate', function (){
				var laydate = layui.laydate;
				laydate.render({
					elem: '#laydate-demo-2',
					type: 'date',
					min: '2008-01-01'
				});
			});
		});
		function submitHandler() {
	        if ($.validate.form()) {
				var data = $('#form-plateinfo-edit').serialize();
				var status = $("input[id='useStatus']").is(':checked') == true ? 0 : 1;
				data = data + "&useStatus=" + status;
	        	$.operate.save(prefix + "/edit", data);
	        }
	    }
	</script>
</body>
</html>
